<?php

Raise::load('core.RaiseObject');
Raise::load('core.collection.RaiseCollection');

/**
 * RaiseAction Class
 * defines an executable action
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package phpraise.core.action
 * @since 1.2
 * @abstract
 */
abstract class RaiseAction extends RaiseObject {
    
    /**
     * A collection of parameters to this action
     * @var RaiseCollection
     */
    private $params;
    
    /**
     * Create a new RaiseAction
     * @param array|RaiseCollection $params (optional) Pass a collection of parameters to this action
     */
    public function __construct($params = array()) {
        $this->params = new RaiseCollection($params);
    }
    
    /**
     * Perform the action
     * @param RaiseApplication $app The Application that is performing this action
     */
    public abstract function action($app);
    
    /**
     * Prepare and add the headers
     * @param RaiseHttpHeaderCollection $headers  A collection of headers to send to the client
     */
    public abstract function header($headers);
    
    /**
     * Prepare and return the output content
     * @return string
     */
    public abstract function output();
    
    /**
     * Get the parameters passed to this RaiseAction
     * @return RaiseCollection
     */
    public function params(){
        return $this->params;
    }
    
}